package com.eian.boot.common.enums;

import com.eian.boot.common.core.enums.IBaseEnum;
import lombok.Getter;

/**
 * 业务操作类型枚举
 *
 * @author alex.meng
 * @createTime 2025-10-14
 */
@Getter
public enum BusinessTypeEnum implements IBaseEnum<Integer> {

    INSERT(1, "新增", "新增数据"),
    UPDATE(2, "修改", "修改数据"),
    DELETE(3, "删除", "删除数据"),
    SELECT(4, "查询", "查询数据"),
    EXPORT(5, "导出", "导出数据"),
    IMPORT(6, "导入", "导入数据"),
    GRANT(7, "授权", "授权操作"),
    FORCE(8, "强退", "强制退出"),
    CLEAN(9, "清空", "清空数据"),
    OTHER(10, "其他", "其他操作");

    private final Integer value;
    private final String label;
    private final String description;

    BusinessTypeEnum(Integer value, String label, String description) {
        this.value = value;
        this.label = label;
        this.description = description;
    }

    public static BusinessTypeEnum getByValue(Integer value) {
        return IBaseEnum.getByValue(BusinessTypeEnum.class, value);
    }

    public static BusinessTypeEnum getByLabel(String label) {
        return IBaseEnum.getByLabel(BusinessTypeEnum.class, label);
    }
}

